from langchain.chat_models import ChatOpenAI
from langchain.schema import (
    AIMessage,
    HumanMessage,
    SystemMessage,
)

chat = ChatOpenAI(openai_api_key="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", model_name="gpt-3.5-turbo")
result = chat([HumanMessage(content = "Hello, world!")])
print(result.content)

messages = [
    SystemMessage(content="You are a helpful assistant that translates English to chinese."),
    HumanMessage(content="Translate this sentence from English to chinese. I love programming.")
]

result = chat(messages)
print(result.content)